package demo6;

import java.util.ArrayList;
import java.util.List;

public class Club {
    private int clubId;
    private String clubDescription;
    private String clubName;
    private int memberCount;
    private String presidentName;
    private String advisorName;
    private List<String> members;

    public Club(int clubId, String clubDescription, String clubName, int memberCount, String presidentName, String advisorName) {
        this.clubId = clubId;
        this.clubDescription = clubDescription;
        this.clubName = clubName;
        this.memberCount = memberCount;
        this.presidentName = presidentName;
        this.advisorName = advisorName;
        this.members = new ArrayList<>();
    }

    // 社团添加
    public static Club addClub(int clubId, String clubDescription, String clubName, int memberCount, String presidentName, String advisorName) {
        return new Club(clubId, clubDescription, clubName, memberCount, presidentName, advisorName);
    }

    // 社团修改
    public void modifyClub(String clubDescription, String clubName, int memberCount, String presidentName, String advisorName) {
        this.clubDescription = clubDescription;
        this.clubName = clubName;
        this.memberCount = memberCount;
        this.presidentName = presidentName;
        this.advisorName = advisorName;
    }

    // 社团查询
    public void queryClub() {
        System.out.println("社团编号: " + clubId);
        System.out.println("社团说明: " + clubDescription);
        System.out.println("社团名称: " + clubName);
        System.out.println("社团人数: " + memberCount);
        System.out.println("社长姓名: " + presidentName);
        System.out.println("社团指导老师: " + advisorName);
        System.out.println("社团成员: " + members);
    }

    // 社团解散
    public void dissolveClub() {
        this.clubId = -1;
        this.clubDescription = "";
        this.clubName = "";
        this.memberCount = 0;
        this.presidentName = "";
        this.advisorName = "";
        this.members.clear();
        System.out.println("社团已解散");
    }

    public void addMember(String member) {
        members.add(member);
        memberCount++;
    }
}